package com.and9.mchen.mcmusic.entity.menum;

import java.util.EnumSet;

public enum Constellation {
	
	ARIES("Aries"),
	TAURUS("Taurus"),
	GEMINI("Gemini"),
	CANCER("Cancer"),
	LEO("Leo"),
	VIRGO("Virgo"),
	LIBRA("Libra"),
	SCORPIO("Scorpio"),
	SAGITTARIUS("Sagittarius"),
	CAPRICORNUS("Capricornus"),
	AQUARIUS("Aquarius"),
	PISCES("Pisces");
	
	private String value;
	 
	public String getValue(){
   	 	return this.value;
    }
    
	private Constellation(String value){
		this.value = value;
    }
	
	public static  Constellation getConstellationByValue(String value){
		
		EnumSet<Constellation> enumSet=EnumSet.allOf(Constellation.class);
		
		for(Constellation constellation : enumSet){
			if(constellation.getValue().equals(value)){
				return constellation;
			}
		}
		
		return null;
	}
	
}
